package face.pay.web.com.cenenter.safe.controller;

import face.pay.util.ResultMessage;
import face.pay.web.com.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: zkj
 * @Date: 2019/9/5 16:41
 * @Description:
 */
@Controller
@RequestMapping("/forGet")
public class ForGetController {

    @Autowired
    IUserService userService;

    @RequestMapping(value = "/toPage", method = RequestMethod.GET)
    public String forGet(HttpServletRequest httpServletRequest) {

        return "com/center/forgetPassword";
    }

    @RequestMapping(value = "/restPassword", method = RequestMethod.POST)
    @ResponseBody
    public ResultMessage getPassword(@RequestParam("domain") String domain,@RequestParam("userName") String userName,@RequestParam("phone") String phone) {
        return userService.restPassword(domain,userName,phone);
    }

}
